home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_12.lha / 8_12 / 8_12a1.c < prev    next >
Text File  |  1993-08-08  |  550b  |  21 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / manage running out of space within the buffer
  6. nt extrabuf::overflow(int c)
  7.  
  8. /cerr << "overflow(" << chr(c) << ") invoked, alloc=" << alloc << "\n"; // DELETE
  9.    if ((alloc ? reallocate() : allocate()) == EOF)
  10. {                    // DELETE
  11. /cerr << "\treturning -1\n";            // DELETE
  12. return EOF;
  13. }                    // DELETE
  14.  
  15.    if (c != EOF)
  16. *pptr++ = c;
  17.  
  18. /cerr << "\treturning " << chr(c) << "\n";    // DELETE
  19.    return c & UCHAR_MAX;
  20.  
  21.